package com.lebang.mapper;

import com.lebang.domain.DownloadMemberRecord;
import com.lebang.entity.TaskRewardsRecord;
import com.lebang.entity.member.LbbMember;
import com.lebang.example.TaskRewardsRecordExample;
import com.lebang.model.cences.NewHandRecordCount;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.time.LocalDateTime;
import java.util.List;
@Repository
public interface TaskRewardsRecordMapper {
    long countByExample(TaskRewardsRecordExample example);

    int deleteByExample(TaskRewardsRecordExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(TaskRewardsRecord record);

    int insertSelective(TaskRewardsRecord record);

    List<TaskRewardsRecord> selectByExample(TaskRewardsRecordExample example);

    TaskRewardsRecord selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") TaskRewardsRecord record, @Param("example") TaskRewardsRecordExample example);

    int updateByExample(@Param("record") TaskRewardsRecord record, @Param("example") TaskRewardsRecordExample example);

    int updateByPrimaryKeySelective(TaskRewardsRecord record);

    int updateByPrimaryKey(TaskRewardsRecord record);

    Integer checkRecord(@Param("rewardsId") Integer rewardsId, @Param("memberId") String memberId);

    TaskRewardsRecord getRecordByMemberIdAndRewardsId(@Param("memberId") String memberId, @Param("id") Integer id);

    TaskRewardsRecord getRecordByMemberIdAndRecordId(@Param("memberId") String memberId, @Param("id") Integer id);

    Integer selectMaxRewardsId(String memberId);

    Long memberCount(@Param("id") Integer id, @Param("memberId") String memberId);

    TaskRewardsRecord selectByMemberIdAndRewId(@Param("id") Integer id, @Param("memberId") String memberId);

    TaskRewardsRecord selectByCash(@Param("memberId") String memberId, @Param("keyvalue") String keyvalue);

    int newHandCount(@Param("star") LocalDateTime star, @Param("end") LocalDateTime end);

    int otherRecordCount(@Param("star") LocalDateTime star, @Param("end") LocalDateTime end);

    List<DownloadMemberRecord> selectAll(@Param("appStore") String appStore, @Param("star") LocalDateTime star, @Param("end") LocalDateTime end);

    List<LbbMember> selectNewMemberList(@Param("star") LocalDateTime star, @Param("end") LocalDateTime end);

    Integer selectFinishTask(@Param("star") LocalDateTime star,@Param("end") LocalDateTime end,@Param("rewardsId") Integer rewardsId,@Param("brand") String brand);

    Integer selectnewFinishTask(@Param("star") LocalDateTime star,@Param("end")  LocalDateTime end,@Param("rewardsId")  Integer rewardsId,@Param("brand")  String brand);

    Integer selectOldFinishTask(@Param("star") LocalDateTime star,@Param("end")   LocalDateTime end,@Param("rewardsId")  Integer rewardsId,@Param("brand")   String brand);

    List<NewHandRecordCount> selectNewUserCount(@Param("star") LocalDateTime star,@Param("end")  LocalDateTime end);

    List<NewHandRecordCount> selectOldUserCount(@Param("star") LocalDateTime star,@Param("end")  LocalDateTime end);

    List<NewHandRecordCount> selectAllUserCount(@Param("star") LocalDateTime star,@Param("end")  LocalDateTime end);
}